home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 48 / MOBICLIC 48.ISO / pc / DATA / DemoAtlas / demo.cst / 00003_Script_gestion du son < prev    next >
Text File  |  2002-07-23  |  2KB  |  79 lines

  1. -- gestion du son
  2.  
  3. global dernierSon,nivSon,volumeOn,menusActifs,ouvreVolume,  chemin
  4. -- dernierSon : nom du dernier son jouΘ
  5. -- nivSon : liste α 3 termes contenant le niveau sonore de chaque piste
  6. -- volumeOn : indique si la fenΩtre de rΘglage du volume est active
  7.  
  8. -- lecture d'un son
  9.  
  10. on joueSon nom, n
  11.   if the paramCount = 1 then
  12.     n = 3
  13.   end if
  14.   if voidP(nivSon)=1 then
  15.     nivSon=[255,255,255]
  16.   end if
  17.   -- ajout Θventuel de "sons:"
  18.   if char 1 to 9 of nom <> "sons" then
  19.     if offset(":", nom) = 0 then
  20.       nom = "sons:" & nom
  21.     end if
  22.   end if
  23.   dernierSon = nom
  24.   --
  25.   put the pathName & nomDos(nom) & ".aif" into nom
  26.   put "  Son jouΘ : " & dernierSon
  27.   sound playFile n, nom
  28.   -- rΘglage du niveau des autres canaux
  29.   repeat with i=1 to 3
  30.     if i<>n and nivSon[i]>102 then
  31.       sound(i).volume = 110
  32.     end if
  33.   end repeat
  34. end joueSon
  35.  
  36. -- jouer un son du cyberCalendrier
  37. on sonCyber son
  38.   ns=char 6 to 7 of the movieName
  39.   joueson ns & "_" & son
  40. end
  41.  
  42. -- rΘglage du volume
  43. on niveauSon
  44.   if voidP(nivson) = 1 then
  45.     nivson=[255,255,255]
  46.   end if
  47.   repeat with i=1 to 3
  48.     sound(i).volume = nivSon[i]
  49.   end repeat
  50. end nivSon
  51.  
  52. -- attendre la fin d'un son
  53. on attendreSon p
  54.   set T = 1.0/the frameTempo
  55.   repeat while soundBusy(p)
  56.     updateStage
  57.     temporise(T)
  58.   end repeat
  59. end
  60.  
  61. -- dΘsactivation des pistes audio
  62. on coupeSon
  63.   repeat with i=1 to the paramCount
  64.     if value(param(i))<>0 then
  65.       puppetSound (param(i)),0
  66.     else
  67.       listeSons param(i)
  68.     end if
  69.   end repeat
  70. end coupeSon
  71.  
  72. on listeSons chaine
  73.   n=offset(">", chaine)
  74.   n1=value(char 1 to n-1 of chaine)
  75.   n2=value(char n+1 to length(chaine) of chaine)
  76.   repeat with j=n1 to n2
  77.     puppetSound j,0
  78.   end repeat
  79. end listeSons